<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="wf" uri="/augurit-wf"%>
 <%@page import="com.augurit.common.system.web.auth.form.LoginUserForm"%>
 <%LoginUserForm form=(LoginUserForm)request.getSession().getAttribute("SES_LOGIN_USER"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- dwr libs -->
<script src="${ctx}/resources/js/ext/adapter/ext/ext-base.js" type="text/javascript"></script>
<script src="${ctx}/resources/js/ext/ext-all.js" type="text/javascript"></script>
 <script src="${ctx}/resources/js/jquery/jquery.js" type="text/javascript"></script>
<script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
<link href="${ctx}/gzcgwsp/resources/css/common-ui.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/resources/components/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<!-- 打印 -->
<script language="JavaScript" src="${ctx}/resources/components/ntko/OfficeContorlFunctions.js"></script>
<script language="JavaScript" src="${ctx}/wf/client/common/js/wf-attachment-public.js"></script>

<script src="${ctx}/gzcgwsp/resources/js/YwEnterprise.js" type="text/javascript"></script>

	<script type="text/javascript">   	
    	function uploadFile(){
		  document.getElementById("fileform").submit();
		}
			function resultValue(result){
			 var faile = Ext.decode(result);
				if(faile.msg==false){
					alert("上传失败!");
					window.close();
				}else{
				    alert("上传成功!");
				    //删除c:temp下的文件
				    
					deleteFile();
					window.close();
					
				}
	}
	//删除文件
	function deleteFile(){     
	   var wshShell =new ActiveXObject("WScript.Shell");          
	    //fso用来处理文件和文件夹   
	    var fso = new ActiveXObject("Scripting.FileSystemObject");   
	       
	    //path删除文件的路径   
	    var path = "c:\\temp";   
	    //如果指定的文件夹存在则返回 True ；否则返回 False   
	    if(fso.FolderExists(path)){   
	      try{   
	           fso.DeleteFile(path+"\\*.*");  
	       }catch(e){   
	             alert(".ceb" + e.message);   
	       }   
	              
	   }else{   
	           alert("不存在这个目录："+path);   
	        }   
	   }   
    </script>
 <body style="text-align:center;">
 <form action="${ctx}/yw-com-print!uploadAttach.action"  enctype="multipart/form-data" id="fileform" name="fileform" method="post" target="upload-target">
 	<input type="hidden" name="templateCode" value="${requestScope.templateCode}"/>
     <input type="hidden" name="ajid" id="ajid" value="${requestScope.ajid}"/>
      <input type="hidden" name="attacheName" value="${requestScope.filename}"/>
      <input type="hidden" name="filetype" value=".ceb"/>
      <input type="hidden" name="username" value="${requestScope.username}"/>
   <table width="500" border="0" cellspacing="2" cellpadding="2" align="center">
       <tr><td></td></tr>
      <tr>
      	<td with=“15%”>选择盖章文件：</td>
        <td><input type="file" name="attach" size="35" class="tpl_list_ui"/></td>
      </tr>  
      <tr><td></td></tr>
      <tr>
      <td colspan="2">
      	<input type="button" value="上  传" onclick="uploadFile();" class="tpl_list_ui"/>
      	<input type="button" value="取 消" onclick="window.close();" class="tpl_list_ui"/>
      </td>
      </tr>
      
    </table>
    <iframe name="upload-target" style="display:none;"></iframe>
    </form>
    </body>
    </head>
    </html>
    
    